/**
 * 表格配置
 * 角色管理 role-manage
 */
export default {
  'role-manage': [
    {
      prop: 'roleName',
      name: '角色名称',
      minWidth: 110
    },
    {
      prop: 'roleCode',
      name: '角色编码',
      minWidth: 110
    },
    {
      prop: 'deptName',
      name: '所属机构',
      minWidth: 110
    },
    {
      prop: 'remark',
      name: '备注',
      minWidth: 120
    },
    {
      prop: 'statusName',
      name: '状态',
      minWidth: 100,
      componentCell: 'CellSwitch',
      authId: 'grass-core:role:enableOrDisable',
      switchConfig: {
        valueTypeProp: 'code',
        dataProp: 'status',
        activeCode: 1,
        activeName: '启用',
        inactiveCode: 2,
        inactiveName: '禁用',
        switchPath: 'roleManage.enableOrDisable',
        switchParamsProp: { id: 'id' }
      }
    },
    {
      name: '操作',
      width: 200,
      fixed: 'right',
      thStyle: { 'text-align': 'left' },
      operateList: [
        {
          type: 'btnText',
          label: '详情',
          id: 'role-manage-search',
          authId: 'grass-core:role:search',
          config: { type: 'text' }
        },
        {
          type: 'btnText',
          label: '新增',
          id: 'role-manage-add',
          authId: 'grass-core:role:add',
          config: { type: 'text' }
        },
        {
          type: 'btnText',
          label: '编辑',
          id: 'rule-manage-edit',
          authId: 'grass-core:role:update',
          config: { type: 'text' },
          disabledRules: {
            ruleList: [{ prop: 'roleCode', value: 'ADMIN' }, { prop: 'isMain', value: 1 }]
          }
        },
        {
          type: 'btnText',
          label: '查看所属用户',
          isMore: true,
          id: 'role-manage-user-look',
          authId: 'grass-core:user:search',
          config: { type: 'text' }
        },
        {
          type: 'btnText',
          label: '编辑所属用户',
          isMore: true,
          id: 'role-manage-user-edit',
          authId: 'grass-core:user:allotRole',
          config: { type: 'text' }
        },
        {
          type: 'btnText',
          label: '删除',
          id: 'role-manage-delete',
          authId: 'grass-core:role:deleteById',
          isMore: true,
          config: { type: 'text' },
          style: { color: '#f74a5c' },
          disabledRules: {
            ruleList: [{ prop: 'roleCode', value: 'ADMIN' }, { prop: 'isMain', value: 1 }]
          }
        }
      ]
    }
  ]
}
